package com.xoa.controller.cms;

import com.xoa.model.cms.TreeModel;
import com.xoa.service.cms.CmsTreeNodeService;
import com.xoa.util.common.wrapper.BaseWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("cmsTreeNode")
public class CmsTreeNodeController {
    @Autowired
    CmsTreeNodeService cmsTreeNodeService;

    @ResponseBody
    @RequestMapping("/treeNode")
    public BaseWrapper treeNode(String id, String siteIds, String chnls){
        BaseWrapper baseWrapper = new BaseWrapper();
        baseWrapper.setFlag(true);
        List<TreeModel> treeModels = cmsTreeNodeService.treeNode(id, siteIds, chnls);
        baseWrapper.setData(treeModels);
        baseWrapper.setStatus(true);
        return baseWrapper;
    }
}
